(function () {
  let eight = ei.querySelector('ul')
  // let eil = Array.from(ei)
  const queryData = function queryData() {
    return new Promise(resolve => {
      let xhr = new XMLHttpRequest;
      xhr.open('GET', './Alljson/热门推荐/data.json');
      xhr.onreadystatechange = () => {
        if (xhr.readyState === 4 && xhr.status === 200) {
          let data = JSON.parse(xhr.responseText);
          resolve(data);
        }
      };
      xhr.send();
    });
  };


  const binding = function binding(data) {
    let str = ``
    data.forEach(item => {
      let { pic, tit, math } = item
      str += `<li>
      <div class="for_position">
        <img src="${pic}"
          alt="">
        <div class="black_box ">
          <div class="headset iconfont">
            &#xe688;
          </div>
          <p>${math}</p>
          <div class="playknew">
          </div>
        </div>
        <a href="javascript:;"></a>
      </div>
      <p class="nop">${tit}</p>
    </li>`
    })
    return str
  }

  queryData().then(value => {
    let html = binding(value)
    eight.innerHTML = html
  })

})()